#include<iostream>
#include<opencv2/opencv.hpp>
#include<iostream>
#include<vector>
using namespace std;
using namespace cv;


class rune_detect
{
public:
	rune_detect(double max_r_area_ratio,
		double min_r_area_ratio,
		double max_target_area_ratio,
		double min_target_area_ratio,
		double thre,
		double max_r_area,
		double min_r_area,
		double max_target_area,
		double min_target_area,
		double max_LengthAndWidth_ratio,
		double min_LengthAndWidth_ratio,
		double the_true_rune_ratio);


	bool lineCircleIntersection(Point2f R_center, Point2f target_center, float radius, Point2f& bottom, Point2f& top, Point2f& left, Point2f& right);
	void dispose_img();
	bool detect_all(Mat& frame);
	bool detect_final();
	void draw_frame();
	void show_img();
	bool detect(Mat& frame);


private:
	vector<cv::Rect> targets;
	vector<cv::Rect> Rs;
	vector<cv::RotatedRect>Rota_targets;
	cv::Rect final_R;
	cv::RotatedRect final__Rota_target;
	Mat frame;
	Mat binary_img;
	Mat binary_img_2;
	Mat binary_img_final;

	//ж
	double max_r_area_ratio;
	double min_r_area_ratio;
	double max_target_area_ratio;
	double min_target_area_ratio;
	double thre;
	double max_r_area;
	double min_r_area;
	double max_target_area;
	double min_target_area;
	double max_LengthAndWidth_ratio;
	double min_LengthAndWidth_ratio;
	double the_true_rune_ratio;






};